package com.yf.stat.modules.total.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yf.base.utils.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
* <p>
* 用户统计数据传输类
* </p>
*
* @author 聪明笨狗
* @since 2021-06-04 08:28
*/
@Data
@ApiModel(value="用户统计", description="用户统计")
public class StatTotalUserDTO implements Serializable {

    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "ID", required=true)
    private String id;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "统计时间")
    private Date statDate;

    @ApiModelProperty(value = "新用户数")
    private Integer newUser;

    @ApiModelProperty(value = "活跃用户数")
    private Integer activeUser;

    @ApiModelProperty(value = "总用户数")
    private Integer allUser;


    /**
     * 月份格式化
     * @return
     */
    public String getDateStr(){
        return DateUtils.formatDate(statDate, "MM/dd");
    }

}
